package org.example.his.common.error;

import org.example.his.common.api.ResponseCode;

public class ServiceException extends RuntimeException {
    private final ResponseCode responseCode;

    public ServiceException(String description) {
        super(description);
        responseCode = ResponseCode.ERROR;
    }

    public ServiceException(ResponseCode responseCode) {
        super(responseCode.getDescription());
        this.responseCode = responseCode;
    }

    public ServiceException(ResponseCode resultCode, String description) {
        super(description);
        this.responseCode = resultCode;
    }

    public ServiceException(ResponseCode responseCode, Throwable throwable) {
        super(responseCode.getDescription(), throwable);
        this.responseCode = responseCode;
    }
}
